package com.pwc.controller;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Map;

/**
 * @author fantuancyh
 * @data 2021/8/21
 */

@Component
@Slf4j
public class DelayConsumer {

    @RabbitListener(queues = "QD")
    public void process(Message testMessage, Channel channel) {

        System.out.println("DelayConsumer收到消息: " + new String(testMessage.getBody())+"，时间为" +  new Date().toString());

    }

}
